package org.example.calc;

import java.util.Scanner;

/**
 * @author TonySong
 * @date 2024/5/7 0007
 * @time 14:13
 */
public class Test {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入第一个操作数：");
        int a = in.nextInt();
        System.out.println("请输入第二个操作数：");
        int b=in.nextInt();
        System.out.println("请输入运算符：");
        char oper = in.next().charAt(0);
        Operation operation = OperationFactory.createOperation(oper, a, b);
        System.out.println(operation.calc());


//        switch (oper) {
//            case '+':
//                System.out.println(a + b);
//                break;
//            case '-':
//                System.out.println(a - b);
//                break;
//            case '*':
//                System.out.println(a * b);
//                break;
//            case '/':
//                System.out.println(a / b);
//                break;
//            default:
//                System.out.println("输入的运算符不正确！");
//        }

    }
}